const { merge } = require('webpack-merge')
const commonWebpackConfig = require('./webpack.common')
const RemoveWebpackPlugin = require('remove-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const prodWebpackConfig = merge(commonWebpackConfig, {
  mode: 'production',
  plugins: [
    new RemoveWebpackPlugin('./dist'),
    new CopyWebpackPlugin({
      patterns: [
        { from: './public/favicon.ico' }
      ]
    })
  ]
})

module.exports = prodWebpackConfig
